<template>
  <div class="xf-house">
    <div class="inner">
      <div class="title-house">
        <h2>深圳优质新房推荐</h2>
        <div class="subtitle">
          <span class="txt">真实楼盘信息，最新楼盘动态</span>
          <span class="more pointer" @click="topage('/filterHouse',null)">更多新房推荐</span>
        </div>
      </div>
      <ul class="list clearfix-1" >
        <li class="pointer" @click="topage('houseDetail',item.id)" v-for="(item,index) in list" :key="index">
          <div class="img">
            <img
              class="ani lazy"
              :src="item.house_banner[0]"
            />
          </div>
          <div class="text">
            <div class="clearfix-1">
              <div class="name">{{item.house_title}}</div>
              <div class="price">{{item.refer_price}}<em>元/㎡</em></div>
            </div>
            <div class="clearfix-1">
              <div class="local">{{item.city}}/{{item.areas}}/ {{item.sale_area}}0m² / {{item.parlour}}房 </div>
              <div class="firstPay">{{item.refer_total_price}}万/套</div>
            </div>
            <div style="min-height: 35px">
              <div class="icon-block block-other">{{item.pro_type}}</div>
              <div class="icon-block block-other">近地铁</div>
              <div class="icon-block block-other">带装修</div>
            </div>
          </div>
        </li>
       
      </ul>
    </div>
  </div>
</template>

<script>
import { defineComponent } from "vue";
import { useRouter } from "vue-router";
export default defineComponent({
  props: {
    list: Array,
  },
  setup(props) {
    const router = useRouter();
    const topage = (route, id) => {
      router.push({ path: route, query: { id } });
    };
    return {
      topage,
    };
  },
});
</script>

<style lang="scss">
.xf-house {
  padding-top: 45px;
  box-sizing: content-box;
  height: 473px;
  background: url("https://alicdn.leyoujia.com/images/index/newhouse.jpg")
    no-repeat center top;
  .inner {
    width: 1200px;
    margin: 0 auto;
    .title-house {
      min-height: 38px;
      h2 {
        display: inline-block;
        font-size: 26px;
        line-height: 36px;
        color: #fff;
        font-weight: 600;
      }
      .subtitle {
        display: flex;
        justify-content: space-between;
        width: 100%;
        .txt {
          font-size: 14px;
          line-height: 24px;
          color: #fff;
        }
        .more {
          float: right;
          font-size: 14px;
          line-height: 24px;
          color: #fff;
           &:hover {
              color: #E03236;
          }
        }
      }
    }
    .list {
      margin-top: 40px;
      display: flex;
      justify-content: space-between;
      list-style: none;
      padding: 0;
      
      li {
          &:hover{ 
          .img {
              img{
                transform: scale(1.05);
              }
          }
      }
        &:first-child {
          margin-left: 0px;
        }
        width: 376px;
        margin-left: 30px;
        background: #fff;
        border-radius: 2px;
        position: relative;
        .img {
          width: 376px;
          height: 211px;
          overflow: hidden;
          border-radius: 2px 2px 0px 0px;
          img {
            width: 100%;
            height: 100%;
            transition: all 0.3s;
          }
        }
        .text {
          padding: 20px 15px;
          box-sizing: border-box;
          width: 100%;
          .clearfix-1 {
            display: flex;
            justify-content: space-between;
            line-height: 1;
            width: 100%;
          }
          .name {
            font-size: 20px;
            font-weight: 600;
            line-height: 28px;
            color: #333;
            max-width: 220px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
          }
          .price {
            font-size: 20px;
            line-height: 23px;
            color: #e03236;
            padding-top: 5px;
            em {
              font-size: 12px;
              font-style: normal;
              font-weight: normal;
            }
          }
          .local {
            font-size: 14px;
            color: #666666;
            padding-top: 8px;
            display: inline-block;
            max-width: 240px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }
          .firstPay {
            font-size: 12px;
            color: #999999;
            padding-top: 9px;
            display: inline-block;
          }
          .icon-block.block-other {
            background: rgba(122, 144, 182, 0.08);
            color: #7a90b6;
            display: inline-block;
            margin-right: 8px;
            padding: 2px 8px;
            font-size: 12px;
            margin-top: 16px;
          }
        }
      }
    }
  }
}
</style>